import Vue from 'vue'
import Router from 'vue-router'

// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
  }
**/
export const constantRouterMap = [
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    name: 'Dashboard',
    hidden: true,
    children: [{
      path: 'dashboard',
      component: () => import('@/views/dashboard/index')
    }]
  },


  {
    path: '/gongcheng',
    component: Layout,
    redirect: '/gongcheng/creat',
    name: '工程填报',
    meta: { title: '工程填报', icon: 'example' },
    children: [
      {
        path: 'create',
        name: '数据输入',
        component: () => import('@/views/gongcheng/creat'),
        meta: { title: '数据输入', icon: 'table' }
      },
      {
        path: 'show',
        name: '生成数据',
        component: () => import('@/views/gongcheng/show'),
        meta: { title: '生成数据', icon: 'tree' }
      },
      {
        path: 'showid/:id',
        name: '查询',
        component: () => import('@/views/gongcheng/publicshow'),
        meta: { title: '查询', noCache: true },
        hidden: true
      },
      {
        path: 'updateid/:id',
        name: '修改',
        component: () => import('@/views/gongcheng/updateShowid'),
        meta: { title: '修改', noCache: true },
        hidden: true
      },
      {
        path: 'tufang',
        name: '土方直立壁开挖神剧计算',
        component: () => import('@/views/gongcheng/tufang'),
        meta: { title: '土方直立壁开挖深度计算', icon: 'tree' }
      }
    ]
    
  },
  {
    path: '/muban',
    component: Layout,
    redirect: '/gongcheng/muban',
    name: '计算书设计',
    meta: { title: '计算书设计', icon: 'tree' },
    children: [
      {
        path: 'muban',
        name: '混凝土侧向压力',
        component: () => import('@/views/gongcheng/muban'),
        meta: { title: '混凝土侧向压力', icon: 'table' }
      },
      {
        path: 'qiangdu',
        name: '面板强度运算',
        component: () => import('@/views/gongcheng/qiangdu'),
        meta: { title: '面板强度运算', icon: 'example' }
      },  
      {
        path: 'nao',
        name: '简支梁验算',
        component: () => import('@/views/gongcheng/nao'),
        meta: { title: '简支梁验算', icon: 'example' }
      }       
    ]
    
  },
  {
    path: '/say',
    component: Layout,
    redirect: '/gongcheng/say',
    name: '建议',
    meta: { title: '建议', icon: 'tree' },
    children: [
      {
        path: 'say',
        name: '留言区',
        component: () => import('@/views/gongcheng/say'),
        meta: { title: '留言区', icon: 'table' }
      },
      {
        path: 'showsay',
        name: '留言墙',
        component: () => import('@/views/gongcheng/showsay'),
        meta: { title: '留言墙', icon: 'example' }
      }        
    ]
    
  },

  {
    path: '/sta',
    component: Layout,
    redirect: '/sta/show',
    name: '图表',
    meta: { title: '画图', icon: 'tree' },
    children: [
      {
        path: 'show',
        name: '图表',
        component: () => import('@/views/sta/show'),
        meta: { title: '图表', icon: 'table' }
      },
      {
        path: 'show1',
        name: '图表1',
        component: () => import('@/views/sta/show1'),
        meta: { title: '图表1', icon: 'table' }
      },
      {
        path: 'show2',
        name: '图表2',
        component: () => import('@/views/sta/show2'),
        meta: { title: '图表2', icon: 'table' }
      },
      {
        path: 'show3',
        name: '图表3',
        component: () => import('@/views/sta/show3'),
        meta: { title: '图表3', icon: 'table' }
      },
      {
        path: 'show4',
        name: '测试',
        component: () => import('@/views/sta/show4'),
        meta: { title: '测试', icon: 'user' }
      }, 
      {
        path: 'show5',
        name: '图表5',
        component: () => import('@/views/sta/show5'),
        meta: { title: '测试', icon: 'password' }
      },       
    ]
    
  },

  {
    path: '/suanliang',
    component: Layout,
    redirect: '/suanliang/jk',
    name: '土方算量',
    meta: { title: '土方算量', icon: 'nested' },
    children: [
      {
        path: 'jk',
        name: '基坑开挖工程量',
        component: () => import('@/views/suanliang/jk'),
        meta: { title: '四边形基坑', icon: 'eye' }
      },
      {
        path: 'circle',
        name: '圆形基坑',
        component: () => import('@/views/suanliang/circle'),
        meta: { title: '圆形基坑', icon: 'form' }
      },
      {
        path: 'load',
        name: '下载资源',
        component: () => import('@/views/suanliang/load'),
        meta: { title: '下载资源', icon: 'link' }
      },
      
             
    ]
    
  },

  {
    path: '/app',
    component: Layout,
    redirect: '/app/shuju',
    name: '数据',
    meta: { title: '填入', icon: 'example' },
    children: [
      {
        path: 'shuju',
        name: '表格录入',
        component: () => import('@/views/app/shuju'),
        meta: { title: '表格录入', icon: 'tree' }
      },
      {
        path: 'hunShow',
        name: '表格输出',
        component: () => import('@/views/app/hunShow'),
        meta: { title: '表格输出', icon: 'table' }
      },

      {
        path: 'showid/:id',
        name: '表格输出',
        component: () => import('@/views/app/showid'),
        meta: { title: '表格输出', icon: 'table' },
        hidden: true
      },

      {
        path: 'addvod',
        name: '视频上传',
        component: () => import('@/views/vod/addvod'),
        meta: { title: '视频上传', icon: 'table' },
        
      },
      
      
      
             
    ]
    
  },
 

 

  { path: '*', redirect: '/404', hidden: true }
]

export default new Router({
  //mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
